﻿using NET6.WebAPI.Attributes;
using SqlSugar;
using System.ComponentModel.DataAnnotations;

namespace NET6.WebAPI.Entities.Base
{
    /// <summary>
    /// 业务表基础类
    /// </summary>
    public class BusinessBase
    {
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        [Key]
        public int ID { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? DeleteTime { get; set; }

        /// <summary>
        /// 恢复时间
        /// </summary>
        public DateTime? RecoverTime { get; set; }

        /// <summary>
        /// 记录状态枚举
        /// </summary>
        public enum RecordStatusEnum
        {
            Active = 0,
            Locked = 1,
            Deleted = 2
        }

        /// <summary>
        /// 记录状态: 0.有效(默认)、1.锁定、2.删除
        /// </summary>
        [IntegrityRate("0")]
        public RecordStatusEnum? RecordStatus { get; set; }
    }
}
